import Opt from '@/components/dt/info/Opt.js'

class Column extends Opt {
  constructor() {
    super()
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      {
        type: 'index',
        title: '序号',
        minWidth: 50,
        fixed: 'left'
      },
      {
        field: 'orgName',
        title: '所属组织',
        minWidth: 160,
        fixed: 'left'
      },
      {
        field: 'housesName',
        title: '案场名称',
        minWidth: 180,
        fixed: 'left'
      },
      {
        field: 'productName',
        title: '产品',
        minWidth: 160
      },
      {
        field: 'contractDate',
        title: '签约日期',
        minWidth: 130,
        cell: {
          text: {
            type: 'date'
          }
        },
        header: {
          filter: {
            title: '签约日期',
            key: 'contractDate',
            placeholder: '请选择',
            date: {
              type: 'daterange'
            },
            data: {
              to: (val) => {
                return {
                  startDate: val[0],
                  endDate: val[1]
                }
              }
            }
          }
        }
      },
      {
        field: 'roomName',
        title: '房源名称',
        minWidth: 160,
        header: {
          filter: {
            title: '房源名称',
            key: 'roomName',
            placeholder: '请输入',
            input: {}
          }
        }
      },
      {
        field: 'customerName',
        title: '客户姓名',
        minWidth: 120,
        header: {
          filter: {
            title: '客户姓名',
            key: 'customerName',
            placeholder: '请输入',
            input: {}
          }
        }
      },
      {
        field: 'area',
        title: '面积(㎡)',
        minWidth: 120,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'unitPrice',
        title: '签约单价(元)',
        minWidth: 150,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'totalPrice',
        title: '签约总价(元)',
        minWidth: 150,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settlementAmount',
        title: '本次结算总销(元)',
        minWidth: 150,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'baseAgentCostStr',
        title: '本次代理费率',
        minWidth: 120
      },

      {
        field: 'actualAgentCost',
        title: '本次结算代理费(含税)(元)',
        minWidth: 200,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settledAgentCost',
        title: '本次结算代理费(不含交房)(元)',
        minWidth: 220,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settledPremiumAgentCost',
        title: '本次结算溢价(元)',
        minWidth: 150,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'settledDeliveryAgentCost',
        title: '本次结算交房代理费(元)',
        minWidth: 180,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'commissionMonth',
        title: '佣金单月份',
        minWidth: 110
      },
      {
        field: 'settlementType',
        title: '佣金单类型',
        minWidth: 110,
        header: {
          filter: {
            title: '佣金单类型',
            key: 'settlementType',
            placeholder: '请选择',
            select: {
              key: 'settlementType'
            }
          }
        }
      },
      {
        field: 'commissionName',
        title: '结算单名称',
        minWidth: 180
      },
      {
        field: 'status',
        title: '状态',
        minWidth: 110
      },
      {
        field: 'bonusMonth',
        title: '关联奖金单月份',
        minWidth: 150
      },
      {
        field: 'writtenOffAmount',
        title: '核销金额(元)',
        minWidth: 150,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'writtenOffDate',
        title: '核销日期',
        minWidth: 130,
        cell: {
          text: {
            type: 'date'
          }
        }
      },
      {
        field: 'counselorName',
        title: '签约人',
        minWidth: 120,
        header: {
          filter: {
            title: '签约人',
            key: 'contractorName',
            placeholder: '请输入',
            input: {}
          }
        }
      }
    ]
  }
}

export default Column
